from web_practice.page_object.wx_base_page import BasePage
from web_practice.page_object.wx_add_member_page import WxAddMemberPage
from web_practice.page_object.wx_contact_page import WxContactPage


class WxMainPage(BasePage):
    _baseurl = 'https://work.weixin.qq.com/wework_admin/frame#index'
    _addMember = ('CSS', ".ww_indexImg_AddMember")

    def goto_contacts(self):
        """
        跳转通讯录
        :return:
        """
        return WxContactPage(self.web_driver)  # 返回通讯录页面对象

    def goto_add_member(self):
        """
        跳转添加成员页
        :return:
        """
        self.find_web_element(*self._addMember).click()
        return WxAddMemberPage(self.web_driver)  # 返回添加成员页面对象
